package es.udc.emarketapp.emarket.model.purchase.purchaseFacade.actions;

import es.udc.emarketapp.emarket.model.orderDetails.dao.SQLOrderDetailsDAO;
import es.udc.emarketapp.emarket.model.orderDetails.dao.SQLOrderDetailsDAOFactory;
import java.sql.Connection;

import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.sql.TransactionalPlainAction;


public class UpdatePaymentDateAction implements TransactionalPlainAction {

    private Long nOrder;

    public UpdatePaymentDateAction(Long nOrder) {
        this.nOrder = nOrder;
    }
    
    public Object execute(Connection connection) 
        throws InternalErrorException, InstanceNotFoundException {        

        SQLOrderDetailsDAO orderDetailsDAO = SQLOrderDetailsDAOFactory.getDAO();

        orderDetailsDAO.updatePaymentDate(connection, nOrder);

        return null;

    }


}

